<template>
	<view class="register-container">
		<view style="height: 100px;"></view>
		<view class="back-btn" @click="goBack">
			<text class="tn-icon-left"></text>

		</view>
			<view class="title">
				<view>您购买的</view>
				<view>
					机型是?
				</view>
			</view>

		<view class="option-list">
			<view class="option-card" :class="{ active: selected === 'offline' }" @click="select('offline')">

				<text class="tn-icon-wifi-no wifi"></text>

				<view class="option-card-header">
					<text class="option-card-title">离线版</text>
					<text class="iconfont option-card-icon">&#xe601;</text>
				</view>
				<view class="option-card-desc">
					在此模式下，您将无法体验APP的联网功能，如远程控制和数据同步等。离线版仅支持本地操作，适合不需要联网管理的用户。如果您以后需要体验更多功能，随时可以切换到联网版。
				</view>
			</view>
			<view class="option-card" :class="{ active: selected === 'wifi' }" @click="select('wifi')">
				<text class="tn-icon-wifi wifi"></text>

				<view class="option-card-header">
					<text class="option-card-title">WIFI版</text>
					<text class="iconfont option-card-icon">&#xe602;</text>
				</view>
				<view class="option-card-desc">
					在此模式下，您可以享受更全面的功能，包括远程控制、实时数据同步以及容量提醒等，让您随时随地管理您的饮水机状态。请确保设备已连接网络，以便充分体验联网版的所有优势。
				</view>
			</view>
		</view>
		<view class="indicator">
			<view class="dot1"></view>
			<view class="dot"></view>
			<view class="dot"></view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			selected: 'offline'
		}
	},
	methods: {

		select(type) {
			// uni.navigateTo({
			// 	url: '/pages/register/add?type=' + type
			// })
			// this.selected = type
			if (type == 'wifi') {
				uni.set
				uni.navigateTo({
					url: '/pages/register/add?type=login' 
				})
			}else{
				uni.navigateTo({
        url: '/pages/index/instruction?type=easy'
      })
			}
		},
		goBack() {
			uni.navigateBack({})
		}
	}
}
</script>

<style scoped lang="scss">
.wifi {
	position: absolute;
	right: 30px;
	top: 10px;
	font-size: 60px;
}

.register-container {
	min-height: 100vh;
	background: #fff;
	padding: 0 0 0 0;
	position: relative;
}

.back-btn {
	position: absolute;
	top: 52rpx;
	left: 24rpx;
	z-index: 10;
	font-size: 40rpx;
	color: #222;
	padding: 10rpx;
}

.title {
	font-size: 46rpx;
	font-weight: bold;
	margin-left: 32rpx;
	margin-bottom: 60rpx;
	color: #111;
}

.option-list {
	display: flex;
	flex-direction: column;
	gap: 32rpx;
	padding: 0 24rpx;
}

.option-card {
	background: #fff;
	border-radius: 24rpx;
	box-shadow: 0 2rpx 16rpx rgba(0, 0, 0, 0.04);
	padding: 42rpx 42rpx 42rpx 42rpx;
	margin-bottom: 0;
	border: 2rpx solid transparent;
	transition: border 0.2s, box-shadow 0.2s, background 0.2s;
	position: relative;
}

.option-card-header {
	display: flex;
	flex-direction: row;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 58rpx;
}

.option-card-title {
	font-size: 30rpx;
	font-weight: bold;
	color: #fff;
}

.option-card-icon {
	font-size: 40rpx;
	color: #fff;
}

.option-card-desc {
	font-size: 29rpx;
	color: #fff;
	line-height: 1.7;
}

.option-card.active {
	background: #111;
	border: 3rpx solid #2e8bff;
	box-shadow: 0 0 0 4rpx #e0f0ff;
	color: #fff;
}

.option-card.active .option-card-title,
.option-card.active .option-card-icon,
.option-card.active .option-card-desc {
	color: #fff;
}

.option-card:not(.active) {
	background: #fafafa;
	border: 2rpx solid #eee;
}

.option-card:not(.active) .option-card-title,
.option-card:not(.active) .option-card-icon {
	color: #222;
}

.option-card:not(.active) .option-card-desc {
	color: #888;
}

.indicator {
	position: fixed;
	bottom: 100rpx;
	right: 350rpx;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 40rpx;
	.dot1 {
	width: 23rpx;
	height: 13rpx;
	border-radius: 30%;
	background: #079a3e;
	margin: 0 5rpx;
	transition: background 0.2s;
}

.dot {
	width: 13rpx;
	height: 13rpx;
	border-radius: 50%;
	background: #e0e0e0;
	margin: 0 5rpx;
	transition: background 0.2s;
}
}



.dot.active {
	background: #2e8bff;
}

.iconfont {
	font-family: 'iconfont' !important;
	font-style: normal;
}
</style>
